<template>
    <div class="count">
        <h3 class="title">{{message.title}}</h3>
        <p class="time">
            <span>发表时间：{{message.time}}</span>
            <span>点击次数：0</span>
        </p>
        <hr>
        <p class="mainC" v-html="message.content"></p>
        <conment-box :news="id"></conment-box>
    </div>
</template>

<script>
import conment from '../subcomponents/conment.vue'
export default {
    data() {
        return {
           id:this.$route.params.id,
           message:[]
        }
    },
    methods: {
        getList(){
            this.$http.jsonp('https://api.jisuapi.com/news/get?channel=%E5%A4%B4%E6%9D%A1&start=4&num=40&appkey=2aab973f248a3b34').then(res => {
               var index=this.id
               this.message=res.body.result.list[index]
            //    cosnoel.log(this.message)
            })
        }
    },
    created(){
        this.getList()
    },
    components:{//用来注册子组件的
        "conment-box":conment
    }
}
</script>

<style lang="scss" scoped>
.count{
    padding:0 4px 5px;
    
    .title{
        color:red;
        text-align:center;
        font-size:22px;
    }
    .time{
        display: flex;
        justify-content:space-between ;
        color:#226aff;
        font-size:16px;
    }
}

</style>